#include "lib/Config.h"
#include "lib/STC8A_Delay.h"
#include "breathled.h"
#include "systick.h"
#include "ttl.h"

void main(void){
	EAXSFR();
	SystickInit();
	BLEDInit();
	TTLInit();
	
	EA = ENABLE;
	
	while(1){
		BLEDTurnOn(BLED_COLOR_RED);
		printf("Color red!");
		delay_ms(3000);
		
		BLEDTurnOn(BLED_COLOR_YELLOW);
		printf("Color yellow!");
		delay_ms(3000);
		
		BLEDTurnOn(BLED_COLOR_GREEN);
		printf("Color green!");
		delay_ms(3000);
		
		BLEDTurnOn(BLED_COLOR_CYAN);
		printf("Color cyan!");
		delay_ms(3000);
		
		BLEDTurnOn(BLED_COLOR_BLUE);
		printf("Color blue!");
		delay_ms(3000);
		
		BLEDTurnOn(BLED_COLOR_PURPLE);
		printf("Color purple!");
		delay_ms(3000);
		
		BLEDTurnOn(BLED_COLOR_WHITE);
		printf("Color white!");
		delay_ms(3000);
		
		BLEDTurnOn(BLED_COLOR_OFF);
		printf("Turn off!");
		delay_ms(3000);
		
		BLEDBreath(BLED_MODE_SINGLE,BLED_COLOR_RED);
		printf("Breath single red!");
		delay_ms(5000);
		
		BLEDBreath(BLED_MODE_SINGLE,BLED_COLOR_YELLOW);
		printf("Breath single yelloW!");
		delay_ms(5000);
		
		BLEDBreath(BLED_MODE_SINGLE,BLED_COLOR_GREEN);
		printf("Breath single green!");
		delay_ms(5000);
		
		BLEDBreath(BLED_MODE_SINGLE,BLED_COLOR_CYAN);
		printf("Breath single cyan!");
		delay_ms(5000);
		
		BLEDBreath(BLED_MODE_SINGLE,BLED_COLOR_BLUE);
		printf("Breath single blue!");
		delay_ms(5000);
		
		BLEDBreath(BLED_MODE_SINGLE,BLED_COLOR_PURPLE);
		printf("Breath single purple!");
		delay_ms(5000);
		
		BLEDBreath(BLED_MODE_SINGLE,BLED_COLOR_WHITE);
		printf("Breath single white!");
		delay_ms(5000);
		
		BLEDBreath(BLED_MODE_COLOR,BLED_COLOR_PURPLE);
		printf("Breath Color mode!");
		delay_ms(20000);
	}
}